@import "tailwindcss";

/* 自定义CSS变量 */
:root {
  --schedule-grid-columns: 8;
  --schedule-grid-rows: 7;
  --course-card-padding: 0.5rem;
  --primary-color: #3B82F6;
  --animation-duration: 0.3s;
  --animation-delay-base: 100ms;
  --background: #ffffff;
  --foreground: #171717;
}

/* 课程表网格样式 */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(var(--schedule-grid-columns), 1fr);
  grid-template-rows: repeat(var(--schedule-grid-rows), minmax(60px, auto));
  gap: 4px;
}

/* 课程卡片样式 */
.course-card {
  transition: all var(--animation-duration) ease;
  border-radius: 8px;
  padding: var(--course-card-padding);
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.course-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-card:active {
  transform: scale(0.98);
}

/* 文本截断样式 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .schedule-grid {
    grid-template-rows: repeat(var(--schedule-grid-rows), minmax(50px, auto));
    gap: 2px;
  }
  
  .course-card {
    padding: 0.25rem;
    font-size: 0.75rem;
  }
  
  .schedule-time-slot {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  .schedule-time-slot .time-text {
    white-space: pre-line;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
  }
}

/* 动画关键帧 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp var(--animation-duration) ease-out;
}

/* 菜单抽屉动画 */
@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

/* 初始状态:隐藏在顶部 */
.menu-drawer-entering {
  opacity: 0;
  transform: translateY(-100%);
}

/* 进入动画 */
.menu-drawer-entered {
  animation: slideDownIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 退出动画 */
.menu-drawer-exiting {
  animation: slideUpOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

/* 已退出(不应该看到这个状态) */
.menu-drawer-exited {
  opacity: 0;
  transform: translateY(-100%);
}

/* 背景遮罩动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 初始状态:完全透明 */
.backdrop-entering {
  opacity: 0;
}

/* 进入动画 */
.backdrop-entered {
  animation: fadeIn 0.3s ease-out forwards;
}

/* 退出动画 */
.backdrop-exiting {
  animation: fadeOut 0.3s ease-out forwards;
}

/* 已退出 */
.backdrop-exited {
  opacity: 0;
}

/* 滚动条样式 */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 高斯模糊背景 */
.backdrop-blur-custom {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #ededed;
  }
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}
